﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HtmlAgilityPack;
using LenderClearingHouse;

namespace LCHWinScraper.SiteScrapers
{
	public class PRIOR : SiteScraper
	{
		public override string Name { get { return "Priority Posting - No Auto Page Function"; } }
		public override string Value { get { return "PRIOR"; } }
		public override string StartUrl { get { return "http://www.priorityposting.com/PPPAdvancedWebSearch/Pages/AdvancedSearchPage.aspx"; } }
		public override string DataUrl { get { return "http://www.priorityposting.com/PPPAdvancedWebSearch/Pages/AdvancedSearchPage.aspx"; } }

		public override string HtmlContent { get; set; }

		public override void ParseDataProcess()
		{
			var doc = new HtmlDocument();
			doc.LoadHtml(HtmlContent);

			string html = doc.DocumentNode.SelectSingleNode("//table[@id='itemPlaceholderContainer']").InnerHtml;

            //string html = File.ReadAllText(@"D:\Projects\Our\Mondruss\Projects\Lender Clearing House\TEMP\aaa.txt");

			ImportDataAccess.BulkCopyOpeningBidApn(PageScrapes.scrapePriorityPosting(html));
		}
	}
}
